using System;
using System.Security.Cryptography;
using SearchAlgorithms.Algorithms.Compare;
using SearchAlgorithms.Interfaces;

namespace SearchAlgorithms.extention
{
    public static class CompareExtension
    {
        public static bool CompareWithSequence(this byte[] src, byte[] dst)
        {
            ICompareAlgorithm CompareAlgorithm = new CompareWithMethod();
            return CompareAlgorithm.CompareWithSequence(src, dst);
        }

        public static bool CompareWithHash(this byte[] src, byte[] dst, HashAlgorithm hash)
        {
            ICompareAlgorithm CompareAlgorithm = new CompareWithMethod();
            return CompareAlgorithm.CompareWithHash(src, dst, hash);
        }

        public static bool Comparison(this byte[] frameA, byte[] frameB)
        {
            ICompareAlgorithm CompareAlgorithm = new CompareWithMethod();
            return CompareAlgorithm.Comparison(frameA, frameB);
        }

        public static bool CompareWithSequence(this Span<byte> src, Span<byte> dst)
        {
            ICompareAlgorithm CompareAlgorithm = new CompareWithMethod();
            return CompareAlgorithm.CompareWithSequence(src, dst);
        }

        public static bool CompareWithHashAsSpan(this byte[] src, byte[] dst, HashAlgorithm hash)
        {
            ICompareAlgorithm CompareAlgorithm = new CompareWithMethod();
            return CompareAlgorithm.CompareWithHashAsSpan(src, dst, hash);
        }

        public static bool Comparison(this Span<byte> frameA, Span<byte> frameB)
        {
            ICompareAlgorithm CompareAlgorithm = new CompareWithMethod();
            return CompareAlgorithm.Comparison(frameA, frameB);
        }

    }
}